<template>
  <div>
    <div class="bgy-screen-top">

      <div class="top-left">
        <div class="top-logo"></div>
        <div class="bgy-line left" style="margin-top: 27px"></div>
        <div class="top-quit" @click="back" v-if="$route.meta.showBack">
          <i class="iconfont icon-back pointer"></i>
        </div>
        <p class="top-name">
          <span class="top-name-span" :title="$route.query.name">{{$route.query.name}}</span>
        </p>
      </div>

      <div class="top-center relative">
        <div class="top-title"></div>
      </div>

      <div class="top-right">
        <span class="top-time">{{time}}</span>

        <span class="relative t-left" v-if="isFullScreen">
          <i class="iconfont icon-daquanping pointer" style="font-size: 22px" @click="fullScreen"></i>
        </span>

        <span class="relative t-left" v-else>
          <i class="iconfont icon-tuiquanping pointer"  style="font-size: 22px" @click="exitScreen"></i>
        </span>

      </div>
    </div>
    <div class="bgy-screen-text">
       <zz-marquee ref="marquee" :contentList="constent" width="90%"></zz-marquee>
    </div>
    <div class="bgy-screen-content">
      <keep-alive>
        <router-view v-if="$route.meta.keepAlive"></router-view>
      </keep-alive>
      <router-view v-if="!$route.meta.keepAlive"></router-view>
    </div>
  </div>
</template>
<script>
  import { mapGetters } from 'vuex'
  export default {
    data () {
      return {
        time: '',
        isFullScreen: true,
        constent: [
          '把安全、质量放在首位！',
          '一切不能保证安全质量的施工都要停工！',
          '合法合规、对人好、对社会好。',
          '集团要建立安全文化，所有的行为、想法都要以安全为中心。',
          '建立一个最好的安全体系，按照追求‘零伤亡’的目标去谋划所有的事。'
        ]
      }
    },
    computed: {
      ...mapGetters({
        currentUser: 'currentUser'
      })
    },
    mounted () {
      this.setTime()
    },
    methods: {
      fullScreen () {
        this.$fullScreen()
        this.isFullScreen = false
      },
      exitScreen () {
        this.$fullExit()
        this.isFullScreen = true
      },
      back () {
        this.$router.push({name: 'videoMap'})
      },
      setTime () {
        this.time = this.$moment().format('YYYY-MM-DD HH:mm,  ddd')
        setInterval(() => {
          this.time = this.$moment().format('YYYY-MM-DD HH:mm,  ddd')
        }, 1000)
      }
    }
  }
</script>
<style lang="scss">
  .bgy-screen-text{
    background-image: url("/static/images/bgy-text.png");
    background-size: 100%;
    height: 102px;
    line-height: 102px;
    position: relative;
    z-index: 1;
  }
  .bgy-screen-content{
    margin: 0 20px 20px 20px;
    .bgy-screen-table{
      width: 100%;
      display: table;
      .bgy-screen-left{
        display: table-cell;
        vertical-align: top;
        width: 100%;
        padding-right: 10px;
      }
      .bgy-screen-right{
        width: 340px;
        display: table-cell;
        vertical-align: top;
        .project-online{
          color: $color-screen;
          margin-top: 4px;
        }
        .project-online-length{
          font-size: 28px;
          font-weight: bold;
          margin-top: 10px;
          color: #fff;
        }
        .project-line{
          width: 1px;
          height: 62px;
          margin: 0 15px;
          background: #055483;
        }
        .camera-online{
          color: $color-screen;
        }
        .camera-arrow{
          width: 60px;
          color: #fff;
        }
        .camera-up{
          color: #00ff60;
        }
        .camera-down{
          margin-top: 17px;
          color: #ff0000;
        }
        .camera-online-length{
          color: #fff;
          font-size: 20px;
          margin-left: 5px;
          margin-right: 5px;
        }
        .icon-jianyoushang{
          color: #00ff60;
          margin-top: 2px;
          display: inline-block;
        }
        .icon-jianyouxia{
          display: inline-block;
          color: #ff0000;
        }
      }
    }
  }
  .tableP-screen{
    border-left: 3px $color-screen solid;
    >span{
      color: #a9c5ec;
      margin-left: 10px;
    }
  }
</style>
